{% include 'front/header.html' %}
<link rel="stylesheet" href="/resource/front/css/invite.css" />
</head>

<body style=" margin: 0 auto;">
	<div class="invite-wrap">
		<img id="bg" src="/resource/front/img/hy.png" alt="">
		<div class="inv-bottom">
			<div id="qrcode"></div>
			<div>长按二维码看资讯赚钱可提现哦！！！</div>
		</div>
	</div>

</body>
<script src="/resource/front/js/qrcode.min.js"></script>
<script src="/resource/front/js/html2canvas.min.js"></script>

</html>
{% include 'front/foot1.html' %}

<script>
	defineClass('init', {
		init: function() {
			var it = this;
			it.params = util.GetRequest(); //获取传参
			util.doAjax({
				url: "/api/Videolist/getUrl",
				method: "post",
				data: {},
				success: function(res) {
					new QRCode(document.getElementById('qrcode'), res.data + "/home/register?be_invite=" + it.params.invite);
					it.initCanvas();
				}
			});

		},
		initCanvas: function() {
			var it = this;
			html2canvas($(".invite-wrap"), {
				onrendered: function(canvas) {
					var url = canvas.toDataURL(); //图片地址
					util.doAjax({
						url: "api/Invite/testSave",
						method: "post",
						data: {
							invite_code: it.params.invite,
							base_64: url
						},
						success: function(res) {
							console.log(res);
						}
					});
				}
			});
		}
	})
</script>